<!DOCTYPE html>
<html lang="<@t.page 'html_lang'/>">
<head>
    <meta charset="utf-8">
    <title>${site.name} - <@t.page "management_system"/></title>
    <meta name="viewport" content="width=device-width,initial-scale=0.6">
    <link href="${base}/resource/plugins/codemirror/lib/codemirror.css" rel="stylesheet"/>
    <link href="${base}/resource/plugins/codemirror/addon/hint/show-hint.css" rel="stylesheet"/>
    <link href="${base}/resource/fonts/font-awesome/css/font-awesome.min.css" rel="stylesheet"/>
    <link href="${base}/resource/fonts/bootstrap-icons/bootstrap-icons.css" rel="stylesheet"/>
    <link href="${base}/resource/plugins/spectrum/spectrum.min.css" rel="stylesheet"/>
    <link href="${base}/resource/css/core.css?version=202302" rel="stylesheet" media="screen"/>
    <link href="${base}/resource/css/print.css" rel="stylesheet" media="print"/>
    <link href="${base}/resource/css/cms.css?version=202302" rel="stylesheet" media="screen"/>
    <script src="${base}/resource/js/echarts.proxy.js"></script>
</head>
<body>
    <header>
        <a class="logo" href="./"><img src="<#if siteAttribute.logo?has_content>${getUrl(siteAttribute.logo)}<#else>${base}/resource/logo.png</#if>" alt="LOGO"/></a>
        <ul class="nav">
            <@sys.authorized roleIds=admin.roles url="cmsDiy/preview">
            <li><a href="cmsDiy/preview.html" target="navTab" rel="cmsDiy/preview"><i class="bi bi-palette2"></i> <@t.page "diy.preview"/></a></li>
            </@sys.authorized>
            <li><a href="${site.dynamicPath!}" target="_blank"><i class="icon-home icon-large"></i></a></li>
        <#if site.useStatic>
            <li><a href="${site.sitePath!}" target="_blank"><@t.page "website"/></a></li>
        </#if>
        <@sys.authorized roleIds=admin.roles url="clearCache">
            <li>
                <a href="clearCache" target="ajaxTodo" title="<@t.page 'button.clear_cache'/>"><i class="icon-rubbish icon-large"></i></a>
            </li>
        </@sys.authorized>
            <li>
                <a href="javascript:"><i class="icon-user icon-large"></i> ${(admin.nickname)!}</a>
            </li>
            <li>
                <a href="logout?userId=${admin.id}" title="<@t.page 'logout'/>"><i class="icon-signout icon-large"></i></a>
            </li>
        </ul>
        <ul id="navMenu">
            <li>
                <a href="javascript:;" onclick="return false;" class="toggleCollapse"><i class="icon icon-chevron-sign-left icon-large"></i></a>
            </li>
    <@sys.moduleList>
        <#list page.list as a>
            <@t.merge "moduleIds" a.id!/>
        </#list>
        <@sys.roleModule roleIds=admin.roles moduleIds=t.moduleIds!><#assign roleModuleMap=map!/></@sys.roleModule>

        <#list page.list as a>
            <#if (roleModuleMap[a.id?string])?has_content&&roleModuleMap[a.id?string]>
                <#if !parentId?has_content><#assign parentId=a.id/></#if>
                <li>
                    <a href="${a.url?has_content?then(a.url,'menus.html?parentId='+a.id)}" parentId="${a.id}"><#if (a.attached)?has_content><i class="${a.attached} icon-large"></i></#if> <@t.menu a.id/></a>
                </li>
            </#if>
        </#list>
    </@sys.moduleList>
    <@tools.masterSite>
        <@sys.authorized roleIds=admin.roles url="sysSite/menu">
            <li>
                <a href="sysSite/menu.html" parentId="site"><i class="icon-sitemap icon-large"></i><@t.menu "site"/></a>
            </li>
        </@sys.authorized>
    </@tools.masterSite>
        </ul>
    </header>
    <main>
        <div id="leftside">
            <div id="sidebar_s"><i class="icon-reorder icon-large"></i></div>
            <div id="sidebar">
                <div id="menu">
                    <#include "menus.html"/>
                </div>
            </div>
        </div>
        <div id="navTab" class="tabsPage">
            <div class="tabsPageHeader">
                <div class="tabsPageHeaderContent">
                    <ul class="navTab-tab">
                        <li tabid="main" class="main" url="main.html"><a href="javascript:;" onclick="return false;"><i class="icon-home icon-large"></i><@t.page "workgin_table"/></a></li>
                    </ul>
                </div>
                <a href="javascript:;" onclick="return false;" class="tabsLeft"><i class="icon-backward icon-large"></i></a>
                <a href="javascript:;" onclick="return false;" class="tabsRight"><i class="icon-forward icon-large"></i></a>
                <a href="javascript:;" onclick="return false;" class="tabsMore"><i class="icon-th-list icon-large"></i></a>
            </div>
            <ul class="tabsMoreList">
                <li><a href="javascript:;" onclick="return false;"><i class="icon-home icon-large"></i><@t.page "workgin_table"/></a></li>
            </ul>
            <div class="navTab-panel tabsPageContent layoutBox">
                <div class="page unitBox work-bench">
                    <#include "main.html"/>
                </div>
            </div>
        </div>
    </main>
    <footer>
        <ul class="langList">
            <@sys.configData code="site"><#assign excludeLangs=(object.site_exclude_lang!'')?split(',')/></@sys.configData>
            <#list langs as k,v>
                <#if !(excludeLangs?has_content && excludeLangs?seq_contains(k))>
            <li<#if t.pageMessage("lang")=k> class="current-lang"</#if>>
                <a href="changeLocale?lang=${k}" target="ajaxTodo">
                    <img src="${base}/resource/images/${k}.png" alt="${v}"/>${v}
                </a>
            </li>
                </#if>
            </#list>
        </ul>
    <@tools.version>
        <#if authorizationEdition>
            <a href="common/license.html" target="dialog" mask="true"><@t.page "license"/>: ${getLicense().authorization!}</a>
        <#else>
            <@t.page "license.no"/>
            <@tools.masterSite>
                <@sys.authorized roleIds=admin.roles url="sysSite/uploadLicense">
            <a href="sysSite/uploadLicense.html" target="navTab" rel="sysSite/uploadLicense" icon="<i class='icon-archive icon-large'></i>" title="<@t.menu 'license'/>"><@t.page "license.upgrade"/></a>
                </@sys.authorized>
            </@tools.masterSite>
        </#if>
    </@tools.version>
        Copyright &copy; ${.now?string("yyyy")}
        <ul class="themeList" id="themeList">
            <li theme="toptry"><div></div></li>
            <li theme="red"><div></div></li>
        </ul>
    </footer>
    <script>
        <#assign editorBasePath=(parentSite!site).dynamicPath/>
        <@sys.configData code="cors"><#if (object.editor_base_path)?has_content><#assign editorBasePath=object.editor_base_path/></#if></@sys.configData>
        var base = "${base+adminContextPath}";
        window.UEDITOR_HOME_URL = "${editorBasePath}resource/plugins/ueditor/";
        window.UEDITOR_LANGUAGE = "<@t.page 'ueditor.lang_js'/>";
        window.CKEDITOR_BASEPATH = "${editorBasePath}resource/plugins/ckeditor/";
        window.CKEDITOR_LANGUAGE = "<@t.page 'ckeditor.lang'/>";
        window.KINDEDITOR_OPTIONS = {
                width:"60%",
                height:"400px",
                basePath:"${editorBasePath}resource/plugins/kindeditor/",
                uploadJson : base + "/kindeditor/upload",
                fileManagerJson : base + "/cmsWebFile/fileList.html",
                allowFileManager : true,
                formatUploadUrl : false
        };
        window.KINDEDITOR_LANGUAGE = "lang/<@t.page 'kindeditor.lang_js'/>.js";
        window.TIMYMCE_HOME_URL = "${editorBasePath}resource/plugins/tinymce/";
        window.TIMYMCE_LANGUAGE = "<@t.page 'tinymce.lang'/>";
        window.TIMYMCE_RESOURCE_PREFIX = "${site.sitePath}";
        window.TIMYMCE_FILETYPES = "<@sys.configData code='safe'>${object.allow_files!}</@sys.configData>";
        window.LOADSCRIPTS_BASE = "${base}";
    </script>
    <script src="${base}/resource/plugins/jquery/jquery.min.js"></script>
    <script src="${base}/resource/plugins/jquery/jquery.cookie.js"></script>
    <script src="${base}/resource/plugins/jquery/jquery.validate.js"></script>
    <script src="${base}/resource/plugins/encrypt/base64.js"></script>
    <script src="${base}/resource/plugins/encrypt/sha512.min.js"></script>
    <script src="${base}/resource/plugins/spectrum/spectrum.min.js"></script>
    <script src="${base}/resource/plugins/spectrum/<@t.page 'spectrum.lang_js'/>"></script>
    <script src="${base}/resource/js/loadscripts.js"></script>
    <script src="${base}/resource/js/loadscripts.config.js"></script>
    <script src="${base}/resource/js/tinymce.config.js"></script>
    <script src="${base}/resource/js/jui.min.js?version=202302"></script>
    <script src="${base}/resource/js/jui.plugins.js?version=202302"></script>
    <script src="${base}/resource/js/lang/regional.<@t.page 'lang'/>.js"></script>
    <script src="${base}/resource/js/cms.js?version=202303"></script>
    <script>
        JUI.init(base + "/common/jui.frag.html", {
            loginUrl:"login_dialog.html", loginTitle:"<@t.page 'login'/>",
            pageInfo:{pageNum:"pageNum", numPerPage:"numPerPage", orderField:"orderField", orderDirection:"orderType"},
            debug:false,
            callback:function(){
                initEnv();
                $("#themeList").theme({themeBase:window.LOADSCRIPTS_BASE+"/resource/css/theme-",defaultTheme:"toptry"});
            <#if admin.weakPassword && admin.loginCount lte 3 >
                <@sys.authorized roleIds=admin.roles url="changePassword">
                $.pdialog.open("myself/password.html?target=dialog", "login", "<@t.page 'user.new_password'/>", {mask: true, width: 450, height: 320});
                </@sys.authorized>
            </#if>
                $("#navMenu li a[parentId=${parentId!0}]").parent().addClass("selected");
                loadScripts([window.LOADSCRIPTS_BASE+"/resource/plugins/echarts/echarts.common.min.js"],function(){
                    echartsProxy(echarts);
                });
            }
        });
    </script>
</body>
</html>